package com.zipking.cloud.springbootmybatis.util;

import java.util.concurrent.CompletableFuture;

public class SupplierB implements SupplierService {
    @Override
    public CompletableFuture<Product> getProductDetails(String productId) {
        System.out.println("productId = " + productId);
        return CompletableFuture.supplyAsync(() -> {
            /*try {
                Thread.sleep(300); // 模拟网络延迟
            } catch (InterruptedException e) {
                throw new IllegalStateException(e);
            }*/
            return new Product(productId, "Product A",150.0,50);
        });
    }
}
